<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<html>
<head>
    <title>个人主页</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            height: 100vh;
        }
        .sidebar {
            width: 200px;
            background-color: #f8f9fa;
            padding: 20px;
            box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        }
        .sidebar ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .sidebar li {
            margin-bottom: 10px;
        }
        .sidebar a {
            display: block;
            padding: 10px;
            color: #333;
            text-decoration: none;
            border-radius: 4px;
            transition: all 0.3s ease;
        }
        .sidebar a:hover {
            background-color: #007bff;
            color: white;
        }
        .main-content {
            flex: 1;
            padding: 20px;
        }
        iframe {
            width: 100%;
            height: 100%;
            border: none;
            background-color: #fff;
        }
        <style>
            /* 新增面包屑导航样式 */
            .breadcrumb {
                padding: 10px 20px;
                background-color: #f8f9fa;
                border-bottom: 1px solid #e2e8f0;
                font-size: 14px;
                color: #666;
            }
            .breadcrumb a {
                color: #007bff;
                text-decoration: none;
                transition: color 0.3s ease;
            }
            .breadcrumb a:hover {
                color: #0056b3;
            }
            .breadcrumb span {
                margin: 0 5px;
                color: #999;
            }
        </style>
    </style>
</head>
<body>
<!-- 新增面包屑导航 -->
<div class="breadcrumb">
    <a href="${pageContext.request.contextPath}/luyou/shouye">首页</a>
    <span>&gt;</span>
    <span>个人中心</span>
</div>
<div class="sidebar">
    <ul>
        <li><a href="${pageContext.request.contextPath}/luyou/gerenxinxi" target="mainFrame">个人资料</a></li>
        <li><a href="shoucang.jsp" target="mainFrame">查看收藏</a></li>
        <li><a href="../dianzan.jsp" target="mainFrame">查看点赞</a></li>
        <li><a href="../comment.jsp" target="mainFrame">查看评论</a></li>
    </ul>
</div>
<div class="main-content">
    <iframe name="mainFrame" src="gerenxinxi.jsp"></iframe>
</div>
</body>
<script>
    // 判断用户是否为空
    if (${empty user}) {
        if (window.top !== window.self) {
            window.top.location.href = '${pageContext.request.contextPath}/luyou/login'; // 跳出 iframe 并跳转到登录页面
        } else {
            window.location.href = '${pageContext.request.contextPath}/luyou/login'; // 直接跳转到登录页面
        }
    }
</script>
</html>
